'''
Created on Oct 12, 2010

@author: zarra
'''
import os
import copy
import locale
ENCODING = locale.getdefaultlocale()[1]
ENCODING = ENCODING if ENCODING else 'utf-8'
PROJECT_PATH     = os.path.abspath(os.path.dirname(__file__))
PROJECT_Parent_PATH=os.path.split(PROJECT_PATH)[0]
STATIC_FILE_PATH = os.path.join(PROJECT_Parent_PATH,'static')
TEMPLATE_PATH    = os.path.join(PROJECT_PATH,'template')

SITE_ROOT = '/expr'


global_conf={
             'global':{
                       #'server.socket_host':'0.0.0.0',
                       #'server.socket_port':8000,
                       'tools.sessions.on': True,

                       }
             }
alone_global_conf=copy.deepcopy(global_conf)
alone_global_conf['global'].update({            
                                    'server.socket_host':'0.0.0.0',
                                    'server.socket_port':8000,
                                    }
                                   )


application_conf ={
                   '/direct/api': {'tools.gzip.on': True},
                   '/static':{'tools.staticdir.root':STATIC_FILE_PATH },
                   '/static/css':{
                                 'tools.gzip.on':True,
                                 'tools.gzip.mime_types':['text/css'],
                                 'tools.staticdir.on':True,
                                 'tools.staticdir.dir':'css',
                                 },
                    '/static/javascript':{
                                 'tools.gzip.on':True,
                                 'tools.gzip.mime_types':['text/javascript'],
                                 'tools.staticdir.on':True,
                                 'tools.staticdir.dir':'javascript',
                                 },
                   '/static/images':{
                                 #'tools.gzip.on':True,
                                 #'tools.gzip.mime_types':['text/javascript'],
                                 'tools.staticdir.on':True,
                                 'tools.staticdir.dir':'images',
                                 },
                   }
if os.name == 'nt':
    driver='mssql' 
else:
    driver='mssql+pymssql'

expr_a = {
           r'url':'%s://expr_sa:@190.1.58.208:1385/expr_a'%driver,
           'echo':False,
           'encoding':ENCODING,
           }
expr_b = {
           r'url':'%s://expr_sa:@190.1.58.208:1385/expr_b'%driver,
           'echo':False,
           'encoding':ENCODING,
           }
fghisdb = {
           r'url':'%s://sa:@190.1.58.207/fghisdb'%'mssql+pymssql',
           'echo':False,
           'encoding':'cp936',
           }

drug_post = {
           r'url':'%s://sa:@190.1.58.17/drug_post'%driver,
           'echo':True,
           'encoding':'cp936',
           }

